package com.lzy.cloud.user.remote;

import com.lzy.cloud.user.remote.request.UserRoleRequest;
import com.lzy.framework.core.output.Result;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @Author: 19516
 * @Despriction:
 * @Date: 2018-06-06 11:28
 */
@FeignClient(name = "lzy-cloud-permission")
public interface PermissionApi {

    /**
     * 拉取用户角色列表
     *
     * @param userRoleRequest
     * @return
     */
    @RequestMapping(value = "/user/role/list" ,method = RequestMethod.POST)
    Result selectUserRoleList(@RequestBody UserRoleRequest userRoleRequest);

    /**
     * 根据userId拉取用户角色列表
     *
     * @param userId
     * @return
     */
    @RequestMapping(value = "/user/role/list/{userId}" ,method = RequestMethod.GET)
    Result selectUserRoleListByUserId(@PathVariable("userId") Long userId);

    /**
     * 查询角色的资源列表
     *
     * @param roleId
     * @return
     */
    @RequestMapping(value = "/sys/role/resource/permission/select/resource/list/{roleId}")
    Result selectResourceListByRole(@PathVariable("roleId") Long roleId);

    /**
     * 查询资源的功能权限列表
     *
     * @param resourceId
     * @return
     */
    @RequestMapping(value = "/sys/role/resource/permission/select/permission/{resourceId}")
    Result selectPermissionByRes(@PathVariable("resourceId") Long resourceId);

    /**
     * 查询角色详情
     *
     * @param id
     * @return
     */
    @RequestMapping(value = "/role/detail/{id}")
    Result selectRoleById(@PathVariable("id") Long id);

}
